# Definition for a binary tree node.
# class TreeNode:
#     def __init__(self, val=0, left=None, right=None):
#         self.val = val
#         self.left = left
#         self.right = right
# class Solution:
#     def postorderTraversal(self, root):
#         if not root:
#             return []
#         T = []
#
#         def dfs(root,T):
#             if not root:
#                 return
#             dfs(root.left,T)
#             dfs(root.right,T)
#             T.append(root.val)
#             return T
#         T = dfs(root,T)
#         return T


#非递归方法

# Definition for a binary tree node.
# class TreeNode:
#     def __init__(self, val=0, left=None, right=None):
#         self.val = val
#         self.left = left
#         self.right = right
class Solution:
    def postorderTraversal(self, root):


